<template>
  <div class="vFormRender">
    <FormListPanel class="vFormRender__formList" ref="formListRef" />
    <FormPanel class="vFormRender__form" />
    <el-button @click="submitAnswer(formStore)"> test </el-button>
  </div>
</template>
<script lang="ts" setup>
import { ref, onMounted, onUpdated, onDeactivated } from "vue";
import FormListPanel from "../components/form-list-panel/index.vue";
import FormPanel from "../components/form-widget/index.vue";
import { useFormStore } from "@bis/stores/form";
import { submitAnswer } from "../utils";

const props = defineProps({
  formDepotId: {
    type: Number,
    required: true,
  },
});
const formListRef = ref(null);

const formStore = useFormStore();

const init = () => {
  // 先重置
  formStore.reset();
  formStore.isDesigner = false;
  formStore.formConfig.formDepotId = props.formDepotId;
};

init();

onMounted(() => {
  formListRef.value.getFormList();
});
</script>
<style lang="scss" scoped>
@import "./index.scss";
</style>
